﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="GameViewModel.cs" company="">
//   
// </copyright>
//  <summary>
//   The game view model.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace Shatranj
{
    /// <summary>
    /// The game view model.
    /// </summary>
    public class GameViewModel : ViewModel
    {
        #region Fields

        /// <summary>
        /// The _chess board view model.
        /// </summary>
        private ChessboardViewModel _chessBoardViewModel;

        /// <summary>
        /// The _game.
        /// </summary>
        private Game _game;

        #endregion

        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="GameViewModel"/> class.
        /// </summary>
        public GameViewModel()
        {
            this.CurrentGame = Game.Blitz;
            this.ChessboardViewModel = new ChessboardViewModel(this.CurrentGame.Board);

            // MoveCalculator.CachePaths();
        }

        #endregion

        #region Public Properties

        /// <summary>
        /// Gets or sets the chessboard view model.
        /// </summary>
        public ChessboardViewModel ChessboardViewModel
        {
            get
            {
                return this._chessBoardViewModel;
            }

            set
            {
                this._chessBoardViewModel = value;
                this.RaisePropertyChanged("ChessboardViewModel");
            }
        }

        /// <summary>
        /// Gets or sets the current game.
        /// </summary>
        public Game CurrentGame
        {
            get
            {
                return this._game;
            }

            set
            {
                this._game = value;
                this.RaisePropertyChanged("CurrentGame");
            }
        }

        #endregion
    }
}